//
//  RecommendHeaderView.swift
//  CWLiving
//
//  Created by 方正刚 on 2017/7/5.
//  Copyright © 2017年 方正刚. All rights reserved.
//

import UIKit
import Kingfisher
class RecommendHeaderView: UICollectionReusableView {

    @IBOutlet weak var groupIcon: UIImageView!
    @IBOutlet weak var tittleLabel: UILabel!
    
    var group: AnchorGroupModel = AnchorGroupModel() {
        
        didSet {
            
            tittleLabel.text = group.tag_name
           
            if group.small_icon_url == "" {
                
                if group.tag_name == "最热" {
                    groupIcon.image = UIImage(named: "home_header_hot")
                    return
                }
                groupIcon.image = UIImage(named: group.icon_name)

            }else {
                
                let smallURL = NSURL(string: group.small_icon_url)
                
                groupIcon.kf.setImage(with: smallURL! as URL)

            }
            
            
        }
        
    }
    
    
    
}
